﻿using Sun.Mvc.Factory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sun.Mvc.BLL
{
    public class Users
    {
        private readonly static IDAL.IUsers dal = DataAccess.CreateUsers();

        /// <summary>
        /// 根据账号和密码获取用户信息
        /// </summary>
        /// <param name="model">用户</param>
        /// <returns></returns>
        public Models.Users GetUserInfoByAccount(Models.Users model)
        {
            return dal.GetUserInfoByAccount(model);
        }

        /// <summary>
        /// 根据账号获得用户的私盐
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <returns></returns>
        public string GetSaltByAccount(string UserName)
        {
            return dal.GetSaltByAccount(UserName);
        }

        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="model">用户</param>
        /// <returns></returns>
        public int Insert(Models.Users model)
        {
            return dal.Insert(model);
        }
    }
}
